package cn.xo68.boot.auth.server.service;

import java.util.List;

import cn.xo68.boot.auth.server.domain.OauthUserRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import cn.xo68.boot.auth.server.mapper.OauthUserRoleMapper;



/** 
 * OauthUserRoleDto Service
 * @author wuyy(16349023@qq.com)
 * @date 2018年08月28日 11:04:12
 *
 */
 @Service
public class OauthUserRoleService{
    @Autowired
    private OauthUserRoleMapper oauthUserRoleMapper;

    public List<String> getUserRoles(String UserId) {
        return  oauthUserRoleMapper.getUserRoles(UserId);
    }

    public void insert(OauthUserRole oauthUserRole) {
        oauthUserRoleMapper.insert(oauthUserRole);
    }

    public void update(OauthUserRole oauthUserRole) {
        oauthUserRoleMapper.update(oauthUserRole);
    }
    
    public void delete(String serialId) {
        oauthUserRoleMapper.delete(serialId);
    }
    
    public List<OauthUserRole> list() {
        return oauthUserRoleMapper.list();
    }
	
	public PageInfo<OauthUserRole> list(int pageNumber,int pageSize) {
        PageHelper.startPage(pageNumber, pageSize,true);
        List<OauthUserRole> docs = oauthUserRoleMapper.list();
        PageInfo<OauthUserRole> pageInfo = new PageInfo<>(docs);
        return pageInfo;
    }
}